#
# PKGBUILD
# This file is part of Nimf.
#
# Unlike other files in the Nimf project,
# this PKGBUILD file is in the public domain.

pkgname=nimf
pkgver=1.1
pkgrel=2
pkgdesc="Nimf is an input method framework."
arch=('any')
url="https://github.com/hamonikr/nimf"
license=('LGPL3')
makedepends=('binutils' 'autoconf' 'automake' 'gcc' 'make' 'glib2' 'intltool'
             'gtk3' 'gtk2' 'qt4' 'qt5-base' 'libappindicator-gtk3' 'librsvg'
             'noto-fonts-cjk' 'libhangul' 'anthy' 'librime' 'libxkbcommon'
             'wayland' 'libxklavier' 'm17n-lib' 'm17n-db' 'gtk-doc')
depends=('glib2' 'gtk3' 'gtk2' 'qt4' 'qt5-base' 'libappindicator-gtk3'
         'libhangul' 'anthy' 'librime' 'libxkbcommon' 'wayland' 'libxklavier'
         'm17n-lib' 'm17n-db')
optdepends=('brise: Rime schema repository'
            'noto-fonts-cjk: Google Noto CJK fonts')
source=("https://github.com/hamonikr/nimf/archive/${pkgver}.tar.gz")
md5sums=('d1141369686a3dd2924474f70525a92f')

pkgver() {
	cd "$srcdir/nimf-$pkgver"
	grep AC_INIT configure.ac | grep -Po '\d{4}.\d{2}.\d{2}'
}

build() {
	cd "$srcdir/nimf-$pkgver"
	./autogen.sh --prefix=/usr --enable-gtk-doc
	make -j 4
}

package() {
	cd "$srcdir/nimf-$pkgver"
	make DESTDIR="${pkgdir}/" install
}
